package com.jc.knights.config;

import com.jc.knights.Knight;
import com.jc.knights.Quest;
import com.jc.knights.impl2.BraveKnight;
import com.jc.knights.impl2.SlayDragonQuest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 效果同knight.xml
 */
@Configuration
public class KnightConfig {

    @Bean
    public Knight knight(){
        return new BraveKnight(quest());
    }

    @Bean
    public Quest quest(){
        return new SlayDragonQuest(System.out);
    }
}
